<!DOCTYPE html>
<html>

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>H+ 后台主题UI框架 - 空白页</title>
    <meta name="keywords" content="">
    <meta name="description" content="">

    <link rel="shortcut icon" href="__STATIC__/layout/favicon.ico">
    <link href="__STATIC__/layout/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="__STATIC__/layout/css/font-awesome.css?v=4.4.0" rel="stylesheet">
    <!-- jqgrid-->
    <link href="__STATIC__/layout/css/animate.css" rel="stylesheet">
    <link href="__STATIC__/layout/css/style.css?v=4.1.0" rel="stylesheet">
    <link href="__STATIC__/layout/css/plugins/sweetalert/sweetalert.css" rel="stylesheet">
    <link href="__STATIC__/layout/css/gyq.css" rel="stylesheet">
    <link rel="stylesheet" href="__STATIC__/layout/css/demo.css" type="text/css">
    <style>
        .radio-inline input[type=radio] {
            margin-top: 4px;
        }
    </style>
</head>

<body style="color:#333;padding:3px;overflow-x: auto">
<!-- 标题 -->
<div class="page-heade clearfix">
    <h1 class="clearfix"><a class="col-md-4 title_color H_right  H_active" id="Ap1" style="font-size: 20px;">库存管理</a> <a
            class="col-md-4 title_color " id="Ap2" style=" font-size: 20px;color:#333;" href="outIn_put_query.html">出入库管理</a>
        <a class="col-md-4 title_color " id="Ap3" style=" font-size: 20px;color:#333;" href="outIn_detail_query.html">出入库明细记录查询</a>
    </h1>
</div>
<!-- 标题 -->
<div class="row-margin-top">
    <form action="" class="form-inline" method="get">
        <table class=" tab-content table-bordered table text-left" border="1">
            <tr>
                <td colspan="7">
                    <a class="btn btn-info" href="{:url('manual_storage')}">手动入库</a><span class="lr_5"></span>
                    <a class="btn btn-info" href="{:url('manual_storage2')}">手动出库</a><span class="lr_5"></span>
                    <a class="btn-info btn" href="javascript:;">调拨入库</a><span class="lr_5"></span>
                    <span id="countName" name="countName"></span>您好，您负责的仓库：
                    {volist name="ckjc" id="row"}
                    <span>{$row}</span>
                    {/volist}
                </td>
            </tr>
            <tr>
                <td>
                    <div class="form-group">
                        <label class="radio-inline">
                            <input type="radio" name="ins2" id="io11" value="option11" {if !$ck}checked{/if}>不分仓库
                        </label>
                        <label class="radio-inline">
                            <input type="radio" name="ins2" id="io21" value="option21" {if $ck}checked{/if}>分仓库
                        </label>

                    </div>
                </td>
                <td style="min-width: 140px;width: 140px" class="text-right"><label for=""
                                                                                    class="form-label">物料名称：</label>
                </td>
                <td><input type="text" class="form-control" name="wlmc" value="{$wlmc}"></td>
                <td style="min-width: 140px;width: 140px" class="text-right"><label for=""
                                                                                    class="form-label">物料类型：</label>
                </td>
                <td>
                    <select name="wlxl" id="" class="form-control">
                        <option value="">全部</option>
                        <option value="1" {if $wlxl==1}selected{/if}>销售物料</option>
                        <option value="2" {if $wlxl==2}selected{/if}>生产物料</option>
                        <option value="3" {if $wlxl==3}selected{/if}>成品</option>
                    </select>
                </td>
                <td style="min-width: 140px;width: 140px" class="text-right"><label for=""
                                                                                    class="form-label">物料编号：</label>
                </td>
                <td><input type="text" class="form-control" name="wlbh" value="{$wlbh}"></td>
            </tr>
            <tr>
                <td  {if !$ck}style="display: none;"{/if} class="ckTd" ><label for="" class="form-label">仓库：</label>
                </td>
                <td class="selectCk" {if !$ck}style="display: none;"{/if} >
                    <select name="ck" id="" class="form-control">
                        <option value="">全部</option>
                        {volist name="cks" id="row"}
                        <option value="{$row.id}" {if $ck==$row.id}selected{/if}>{$row.ckjc}</option>
                        {/volist}
                    </select>
                </td>
                <td colspan="7" class="text-center TdBtn">
                    <button class="btn btn-info query" type="submit">查询</button>
                    <button class="btn btn-info emptyIf" type="button">清空</button>
                    <button class="btn btn-info LendExcel" type="button">导出Excel</button>
                </td>
            </tr>
        </table>
        <table class="table table-bordered" style="margin-bottom:0">
            <tr>
                <td class="text-left">
                    <div class="form-group" style="margin-top: 8px;">
                        库存数量：<span id="kucunNum">{$kcsl}</span>；库存体积：<span
                            id="kucunBulk">{$tj}</span>立方米；库存重量：<span id="kuncunWeight">{$zl}</span>吨
                    </div>
                    <a class="btn-info btn" href="javascript:;" style="float: right;">回收站</a>
                </td>
            </tr>
            <tr>
                <td class="text-left" style="border-bottom: 0">
                    <button class="btn-info btn" id="delInfo" type="button">删除</button>
                </td>
            </tr>
        </table>
        <table class="table row-margin-top table-bordered text-center bud_hei" style="margin-top: 0" id="kuncunTable">
            <thead>
            <tr class="info">
                <th style="vertical-align: middle !important;text-align: center;"><input type="checkbox" id="checkAll">
                </th>
                <th class="text-center">NO.</th>
                <th class="text-center">物料类型</th>
                <th class="text-center">物料类别</th>
                <th class="text-center">产品品类</th>
                <th class="text-center">物料编号</th>
                <th class="text-center">物料名称</th>
                <th class="text-center">规格</th>
                <th class="text-center">单位</th>
                <!--<th class="text-center">单价(元)<span class="helpText">帮</span></th>-->
                <th class="text-center">数量</th>
                <!--<th class="text-center">金额(元)</th>-->
                <th class="text-center">体积(立方米)</th>
                <th class="text-center">重量(KG)</th>
            </tr>
            </thead>
            {volist name="data" id="row" key="k"}
            <tr>
                <td><input type="checkbox" name="kcx" value="{$row.id}"></td>
                <td>{$k+(request()->param('page')?request()->param('page'):1-1)*10}</td>
                <td>{if $row.wlxl==1}销售物料{elseif $row.wlxl==2}生产物料{else}成品{/if}</td>
                <td>{$row.wllb}</td>
                <td>{$row.cppl}</td>
                <td>{$row.wlbh}</td>
                <td class="text-left">{$row.wlmc}</td>
                <td>{$row.gg}</td>
                <td>{$row.kcdw}</td>
                <!--<td class="text-right"><span class="ObjectNum">216</span>00</td>-->
                <td class="text-right"><span>{$row.kcsl}</span></td>
                <!--<td class="text-right"><span class="ObjectNum">21912240816</span>00</td>-->
                <td class="text-right"><span class="ObjectNum">{$row.tj}</span></td>
                <td class="text-right"><span>{$row.zl}</span></td>
            </tr>
            {/volist}
        </table>
        <div class="row text-center" id="pageText" style="padding: 0;margin: 0;">
					<div class="col-sm-6 text-left"><div class="padding-10 countSize">共{$count}条记录，{$maxpage}页&nbsp;&nbsp;</div></div>
				<div class="col-sm-6 text-right">{$page}</div>
		</div>
    </form>
</div>
<!-- 全局js -->
<script src="__STATIC__/layout/js/jquery.min.js?v=2.1.4"></script>
<script src="__STATIC__/layout/js/bootstrap.min.js?v=3.3.6"></script>
<!-- <script src="js/plugins/metisMenu/jquery.metisMenu.js"></script> -->
<script src="__STATIC__/layout/js/plugins/slimscroll/jquery.slimscroll.min.js"></script>
<!--统计代码，可删除-->
<!-- <script src="js/plugins/layer/laydate/laydate.js"></script> -->
<script src="__STATIC__/layout/js/plugins/sweetalert/sweetalert.min.js"></script>
<script src="__STATIC__/layout/js/plugins/layer/layer.min.js"></script>
<script src="__STATIC__/layout/js/common.js"></script>
<script>
    $(document).ready(function () {
        $('#delInfo').on('click',function () {
            swal({
                title: "您确定要删除这条信息吗",
                text: "删除后会丢进回收站！",
                type: "warning",
                showCancelButton: true,
                confirmButtonColor: "#DD6B55",
                confirmButtonText: "删除",
                closeOnConfirm: false
            }, function (isConfirm) {
                if(isConfirm){
                    var d = []
                    $('[name=kcx]:checked').each(function (i,o) {
                        d.push($(o).val())
                    })
                    $.post('{:url("sckc")}',{ids:d},function (data) {
                        if(data.success){
                            swal({title:data.msg},function () {
                                location.reload()
                            })
                        }else{
                            swal('',data.msg,'error')
                        }
                    },'json')
                }
            })

            return false
        })
        $('#checkAll').on('click',function () {
            if($(this).prop('checked'))
                $('[name=kcx]').prop('checked',true)
            else
                $('[name=kcx]').prop('checked',false)

        })
        $('.emptyIf').on('click',function () {
            $(this).closest('form').find('input').val('')
            $(this).closest('form').find('select').val('')

        })
        var $ObjectNum = $(".ObjectNum");
        toNum($ObjectNum);
        $("input:radio[name=ins2]").click(function () {
            if ($("#io11").prop("checked") != true) {
                $(".ckTd").show();
                $(".selectCk").show();
                $(".TdBtn").attr("colspan", 5)
                $('[name=ck]').prop('disable',false)
                addCol();
            } else {
                delCol();
                $(".ckTd").hide();
                $(".selectCk").hide();
                $(".TdBtn").attr("colspan", 7)
                $('[name=ck]').prop('disable',true)

            }
            ;
        });
    })

    /*分仓与不分仓选择*/
    // val = $("table").find("tr").eq(row).find("td").eq(col).text();
    function addCol() {
        $th = "<th class='text-center'>仓库</th>";
        $col = "<td>广州仓</td>";
        $("#kuncunTable>thead>tr").find("th").eq(1).after($th);
        $("#kuncunTable>tbody>tr").each(function () {
            $(this).find("td").eq(1).after($col);
        })
    }

    function delCol() {
        $("#kuncunTable>thead>tr").find("th").eq(2).remove();
        $("#kuncunTable>tbody>tr").each(function () {
            $(this).find("td").eq(2).remove();
        })
    }
</script>
</body>

</html>
